﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using Xinkui.WebModel.BasicControl;
using Xinkui.WebModel.Model;
using Xinkui.WebModel.Data;
using Xinkui.WebModel.Cache;

public partial class UserControl_ShowRoom_UC_Left : ShowRoomControl {
    protected void Page_Load(object sender, EventArgs e) {

        List<PropertyItem> properties = new List<PropertyItem>(5);
        if (!string.IsNullOrEmpty(this.CompanyView.CompanyEntity.StreetAddress))
            properties.Add(new PropertyItem {
                Title = "Street Address",
                Value = this.CompanyView.CompanyEntity.StreetAddress
            });

        if (!string.IsNullOrEmpty(this.CompanyView.City))
            properties.Add(new PropertyItem {
                Title = "City",
                Value = this.CompanyView.City
            });
        if (!string.IsNullOrEmpty(this.CompanyView.Province))
            properties.Add(new PropertyItem {
                Title = "Province",
                Value = this.CompanyView.Province
            });

        if (!string.IsNullOrEmpty(this.CompanyView.CountryName))
            properties.Add(new PropertyItem {
                Title = "Country/Region",
                Value = this.CompanyView.CountryName
            });

        this.rptPropertyDataSource.DataSource = properties;
        this.rptPropertyDataSource.DataBind();

        QueryData = ShowRoomQueryData.Create();

        var views = CategoryCache.ListCategoryByCompany(BasePage.ShowRoomIdentity);
        this.rptLeftDataSource.DataSource = views;
        this.rptLeftDataSource.DataBind();


    }

    protected ShowRoomQueryData QueryData { get; set; }
}